/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.srcptit.trainning.giangnd.b2;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;      

import java.io.IOException;

/**
 *
 * @author GIANG
 */
public class ghifile {
    public static void main(String[] args) throws IOException {
        try (BufferedWriter bf = new BufferedWriter(new FileWriter("Giang.txt"))) {
            bf.write("Anh Đông");
            //     bf.newLine();
            bf.write("20");
            bf.newLine();
            bf.write("Chi Thơ");
            bf.write("20");
            bf.close();
        }
        
        BufferedReader br=new BufferedReader(new FileReader("Giang.txt"));
            while(br.ready() == true ){
            System.out.println(br.readLine());            
        }
    }
}
